package org.openarchitectureware.recipe2.findbugs;

import org.apache.bcel.classfile.JavaClass;

import edu.umd.cs.findbugs.BugReporter;
import edu.umd.cs.findbugs.ba.AnalysisContext;
import edu.umd.cs.findbugs.classfile.ClassDescriptor;
import edu.umd.cs.findbugs.classfile.DescriptorFactory;

public class BCELUtil {
	public static JavaClass getJavaClass(BugReporter bugReporter, String className) {
		ClassDescriptor descriptor = DescriptorFactory.createClassDescriptorFromDottedClassName(className);
		JavaClass javaClass = null;
		try {
			javaClass = AnalysisContext.currentAnalysisContext().lookupClass(descriptor);
		} catch (ClassNotFoundException e) {
		}
		if (javaClass == null) {
			//bugReporter.reportMissingClass(descriptor);
		}
		return javaClass;
	}

	private BCELUtil(){}
	
}
